package com.sx.first.biz;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.sx.first.biz.PositionBiz;
import com.sx.first.dao.PositionDAO;
import com.sx.first.model.Position;

@Service("positionBiz")
@Scope("prototype")
public class PositionBiz {
	private PositionDAO positionDAO;
	
	public void setPositionDAO(PositionDAO positionDAO) {
		this.positionDAO = positionDAO;
	}


	public List<Position> findAll() {
		return positionDAO.findAll();
	}
	

	public Position findById(int posId) {
		return positionDAO.findById(posId);
	}


	public void delete(int posId) {
		positionDAO.delete(positionDAO.findById(posId));
		
	}

	public void update(Position pos) {
		positionDAO.update(pos);
		
	}
	
	public void sava(Position pos){
		positionDAO.save(pos);
	}


	public List<Position> findAllByDepId(Integer depId) {
		return positionDAO.findAllByDepId(depId);
	}
	

}
